package com.itheima.bos.dao.take_delivery;

import java.util.Date;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import com.itheima.bos.domain.take_delivery.Promotion;

public interface PromotionRepository extends JpaRepository<Promotion, Integer> {

	@Query(value = "update Promotion set status = '2' where ? > endDate and status = '1'")
	@Modifying
	void updatePromotionStauts(Date date);

}
